package com.maiji.cloud.microservice;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.maiji.cloud.entities.login.Label;
import com.maiji.cloud.service.LabelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/label/")
public class LabelController {

    @Autowired
    private LabelService labelService;

    @GetMapping("selectOne")
    public Label findAllUserInfosByNickName (@RequestParam(name = "source") String source, @RequestParam(name = "name") String name) {
        EntityWrapper<Label> labelEntityWrapper = new EntityWrapper<>();
        labelEntityWrapper.eq("source", source);
        labelEntityWrapper.eq("name", name);
        return labelService.selectOne(labelEntityWrapper);
    }

}
